package com.aidex.biz.service;

import com.aidex.biz.domain.Customer;
import com.aidex.biz.domain.PushRuleUser;
import com.aidex.biz.domain.XiansuoChengbenLog;
import com.aidex.biz.domain.vo.GuanggaoChengBen;
import com.aidex.biz.domain.vo.HeJiGuanggaoChengBen;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.service.BaseService;
import com.github.pagehelper.PageInfo;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 线索成本记录Service接口
 *
 * @author sean
 * @email 2074844820@qq.com
 * @date 2025-03-24
 */
public interface XiansuoChengbenLogService extends BaseService<XiansuoChengbenLog> {

    /**
     * 批量删除线索成本记录
     *
     * @param ids 需要删除的线索成本记录ID集合
     * @return 结果
     */
    public int deleteXiansuoChengbenLogByIds(String[] ids);

    /**
     * 获取最大编号
     *
     * @param xiansuoChengbenLog 线索成本记录
     * @return 结果
     */
    public int findMaxSort(XiansuoChengbenLog xiansuoChengbenLog);

    /**
     * 根据实时成本配置表保存线索成本记录
     *
     * @param xiansuoChengbenLogParam
     * @return
     */
    @Transactional(readOnly = false)
    public boolean saveByCityAndLaiyuan(XiansuoChengbenLog xiansuoChengbenLogParam);

    /**
     * 更新业务员信息 旧
     *
     * @param customer
     * @param user
     * @return
     */
    @Transactional(readOnly = false)
    public boolean updateUserInfo(Customer customer, SysUser user);

    /**
     * 更新业务员信息 新
     *
     * @param customer
     * @param user
     * @return
     */
    @Transactional(readOnly = false)
    public boolean updateUserInfo(Customer customer, PushRuleUser user);


    /**
     * 广告成本合计
     */
    public HeJiGuanggaoChengBen hejiGuanggaochengben(XiansuoChengbenLog xiansuoChengbenLog);


    /**
     * 统计线索成本
     *
     * @param xiansuoChengbenLog
     * @return
     */
    public PageInfo<GuanggaoChengBen> pageGuanggaoChengben(XiansuoChengbenLog xiansuoChengbenLog);

    /**
     * 导出统计线索成本
     *
     * @param xiansuoChengbenLog
     * @return
     */
    public List<GuanggaoChengBen> guanggaoChengben(XiansuoChengbenLog xiansuoChengbenLog);

    /**
     * 更新之前没成本的记录
     *
     * @param xiansuoChengbenLog
     * @return
     */
    @Transactional(readOnly = false)
    public int updateNoCostData(XiansuoChengbenLog xiansuoChengbenLog);

    /**
     * 查询成交对应的成本记录
     *
     * @param xiansuoChengbenLog
     * @return
     */
    public XiansuoChengbenLog findOneChengjiaoLasted(XiansuoChengbenLog xiansuoChengbenLog);
}
